package com.wutoon.etl.config;/**
 * @author Stephen Wu
 * @date 2022-12-03
 */

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @ClassName DatasourceConfig
 * @Description TODO
 * @Author wuxy
 * @DateTime 2022/12/3 23:40
 **/
@Configuration
public class DatasourceConfig {
    /**
     *加载数据源到spring的容器中，引用配置文件的配置
     * @return
     */
    @ConfigurationProperties(prefix = "spring.datasource")
    @Bean
    public DataSource druidDataSource(){
        return new DruidDataSource();
    }

}
